package com.sugar.queryinfo.module.business.util;

import cn.hutool.core.util.DesensitizedUtil;
import cn.hutool.core.util.StrUtil;

public class HideUtil {

    public static String name(String name){
        if (StrUtil.isBlank(name))
            return "";

        if (name.length() == 1){
            return name;
        } else if(name.length() == 2){
            return DesensitizedUtil.chineseName(name);
        }else {
            return StrUtil.hide(name, 1, name.length() - 1);
        }
    }

    public static String idCard(String idCard){
        return DesensitizedUtil.idCardNum(idCard, 1, 1);
    }

    public static String mobile(String mobile){
        return DesensitizedUtil.mobilePhone(mobile);
    }
}
